package com.hfy.music.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hfy.model.Bo.AlbumBo;
import com.hfy.model.dto.AlbumDto;
import com.hfy.model.po.music.AlbumPo;
import com.hfy.model.vo.AlbumVo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @ author 韩
 * time: 2024/7/17 15:16
 */
@Mapper
public interface AlbumMapper extends BaseMapper<AlbumPo> {

    @Insert("INSERT INTO `album` (`cover`, `name`, `musician_account`, `style_id`, `des`)" +
            "VALUES (#{cover}, #{name}, #{account}, #{styleId}, #{des})")
    void insertAlbum(AlbumDto dto);

    @Select("SELECT `id`, `cover`, `name` FROM `album` WHERE `musician_account` = #{account} AND `is_online` = 0")
    List<AlbumVo> getAlbums(@Param("account") Long account);

    List<AlbumBo> selectAlbumInfoByIdList(@Param("idList") List<Integer> idList);

}




